<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
  <div id="root"></div>
  <script>
    // 将一个模板字符串编译成 render 函数。只在完整版时可用。
    // 重点 render 函数
    var res = Vue.compile('<div><span>{{ firstName }}</span></div>')

    var Profile = Vue.extend({
      data: function () {
        return {
          firstName: 'walter',
          lastName: 'white',
          alias: 'heisenberg',
          obj: {
            a: 1
          }
        }
      },
      render: res.render,
      staticRenderFns: res.staticRenderFns
    })

    new Profile().$mount('#root');
</script>
</body>
</html>